package cn.iocoder.yudao.module.crm.dal.mysql.mobileencryptconfig;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crm.dal.dataobject.mobileencryptconfig.MobileEncryptConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crm.controller.admin.mobileencryptconfig.vo.*;

/**
 * 号码隐私设置 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface MobileEncryptConfigMapper extends BaseMapperX<MobileEncryptConfigDO> {

    default PageResult<MobileEncryptConfigDO> selectPage(MobileEncryptConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MobileEncryptConfigDO>()
                .eqIfPresent(MobileEncryptConfigDO::getStatus, reqVO.getStatus())
                .eqIfPresent(MobileEncryptConfigDO::getPrefix, reqVO.getPrefix())
                .eqIfPresent(MobileEncryptConfigDO::getSuffix, reqVO.getSuffix())
                .eqIfPresent(MobileEncryptConfigDO::getText, reqVO.getText())
                .eqIfPresent(MobileEncryptConfigDO::getDeptIds, reqVO.getDeptIds())
                .eqIfPresent(MobileEncryptConfigDO::getUserIds, reqVO.getUserIds())
                .betweenIfPresent(MobileEncryptConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MobileEncryptConfigDO::getId));
    }

}